package com.design03_behavioral.pattern21_command;

/**
 * @ClassName Client
 * @Description TODO
 * @Author 22963
 * @DATE 2023/9/10 23:25
 */
public class Client {

    public static void main(String[] args) {
        Order order1 = new Order();
        order1.setDiningTable(1);//餐桌
        order1.getFoodMenu().put("鲍鱼炒饭",1);
        order1.getFoodMenu().put("茅台迎宾",1);
        Order order2 = new Order();
        order2.setDiningTable(3);//餐桌
        order2.getFoodMenu().put("海参炒面",1);
        order2.getFoodMenu().put("五粮液",1);

        //创建接收者
        Chef chef = new Chef();

        //将订单和接收者封装成命令对象
        OrderCommand cmd1 = new OrderCommand(chef,order1);
        OrderCommand cmd2 = new OrderCommand(chef,order2);

        //创建调用者
        Waiter invoke = new Waiter();
        invoke.setCommands(cmd1);
        invoke.setCommands(cmd2);

        //将订单发送到后厨
        invoke.orderUp();
    }

}
